import 'package:unify_flutter/version.dart';

/// Define suffix constant
const dartSuffix = '.dart';
const javaSuffix = '.java';

/// Define built-in file constant names
const builtInFileNameUniModel = 'UniModel';
const builtInFileNameCaches = 'caches';
const builtInFileNameUniCallback = 'uni_callback';
const builtInFileNameModel = 'uni_model';
const builtInFileNameUniApi = projectNameSnake;
const builtInFileUniCallbackManager = 'uni_callback_manager';

const dotJavaFileUniModel = '$builtInFileNameUniModel$javaSuffix';
const dotDartFileCaches = '$builtInFileNameCaches$dartSuffix';
const dotDartFileUniCallback = '$builtInFileNameUniCallback$dartSuffix';
const dotDartFileModel = '$builtInFileNameModel$dartSuffix';
const dotDartFileUniApi = '$builtInFileNameUniApi$dartSuffix';
const dotDartFileUniCallbackManager =
    '$builtInFileUniCallbackManager$dartSuffix';
const dotDartFileprojectNameSnake = '$projectNameSnake$dartSuffix';

/// Project Information Constants
const projectName = 'uniapi';
// Encodes a name of project named `snakeCase` with a name `snake_case`.
const projectNameSnake = 'uni_api';
// Encodes a name of project named `pascalCase` with a name `PascalCase`.
const projectNamePascal = 'UniApi';
// Encodes a name of project named `camelCase` with a name `camelCase`.
const projectNameCamel = 'uniAPI';

/// othor --
const kUniAPI = 'UniAPI';
const kRegister = 'Register';

/// Annotation Name
const uniNativeModuleAnnotation = 'UniNativeModule';
const uniFlutterModuleAnnotation = 'UniFlutterModule';
const uniModelAnnotation = 'UniModel';
const ignoreErrorAnnotation = 'IgnoreError';

/// Default buid-in type
const typeUniCallbackManager = 'UniCallbackManager';
const typeUniCallback = 'UniCallback';
const typeFlutterError = 'FlutterError';
const typeFuture = 'Future';

/// Collection of keys used in dictionaries across generators.
class Keys {
  /// The key in the result hash for the 'result' value.
  static const String result = 'result';

  /// The key in the result hash for the 'error' value.
  static const String error = 'error';

  /// The key in an error hash for the 'code' value.
  static const String errorCode = 'code';

  /// The key in an error hash for the 'message' value.
  static const String errorMessage = 'message';

  /// The key in an error hash for the 'details' value.
  static const String errorDetails = 'details';

  /// The key is a function name 'mapClone'
  static const String mapClone = 'mapClone';

  /// The key is a function name 'listClone'
  static const String listClone = 'listClone';

  /// The key is a function name 'listConvert'
  static const String listConvert = 'listConvert';

  /// The key is a function name 'mapConvert'
  static const String mapConvert = 'mapConvert';
}

/// Comment content at the beginning of the file
const fileHeaderComments =
    'Autogenerated from Unify $packageVersion, do not edit directly.';

const String generatedWarning = '''
// =================================================
// $fileHeaderComments
// =================================================
''';

const gitUrl = 'https://github.com/didi/unify.git';

/// Unify built-in annotation meaning description
const uniNativeModuleDesc = 'Call flow direction : dart -> native';
const uniFlutterModuleDesc = 'Call flow direction : native -> dart';
